package prime.test;

import java.util.LinkedList;
import java.util.List;

import javax.faces.bean.ManagedBean;

@ManagedBean
public class IndexBean {
	private String valueIndex = "Joan";
	private Cliente clienteSelect;

	public String getValueIndex() {
		return valueIndex;
	}

	public void setValueIndex(String valueIndex) {
		this.valueIndex = valueIndex;
	}

	public Cliente getClienteSelect() {
		return clienteSelect;
	}

	public void setClienteSelect(Cliente clienteSelect) {
		this.clienteSelect = clienteSelect;
	}

	public List<String> listComplete(String query) {
		List<String> list = new LinkedList<String>();

		for (int i = 0; i < valueIndex.length(); i++) {
			list.add(query + "_" + i);
		}

		return list;
	}

	public List<Cliente> listCompleteClientes(Cliente input) {
		List<Cliente> clientes = new LinkedList<Cliente>();

		for (int i = 0; i < input.getRazonSocial().length(); i++) {
			clientes.add(new Cliente(i, "RS_" + i, "NIT_" + i));
		}

		return clientes;
	}

}
